package cn.community.system.mapper;

import cn.community.system.domain.Role;
import cn.community.system.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role role);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role role);

    List<Role> selectForList(QueryObject qo);

    void insertRelation(@Param("rid") Long rid, @Param("pid") Long pid);

    void deleteRelation(Long id);

    Long[] findAllId();

    Long[] findlIdByName(String name);

    List<String> selectNameByAssoId(Long id);

    List<String> selectSnByMemId(Long id);

    Long findlIdByRoleName(String name);

    Long searchRelation(@Param("rid")Long rid,@Param("pid") Long pid);

    void deleteByRidAndPid(@Param("rid")Long rid,@Param("pid") Long pid);
}